<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>margin负值</title>
</head>
<style>
    body {
        margin: 20px;
    }

    .float-left {
        float: left;
    }

    .clearfix:after {
        content: '';
        display: table;
        clear: both;
    }

    .container {
        border: 1px solid #000000;
        padding: 10px;
    }

    .container .item {
        width: 100px;
        height: 100px;
    }
    .container .border-blue{
        border: 1px solid blue;
    }
    .container .border-red{
        border: 1px solid red;
    }
</style>
<body>
<p>用于测试margin top bottom 的负数情况</p>
<div class="container">
    <div class="item border-blue" style="margin-top: -20px;margin-bottom: -20px;">item1</div>
    <div class="item border-red">item2</div>
</div>
<p>用于测试margin left right 的负数情况</p>
<div class="container clearfix">
    <div class="item float-left border-blue" style="margin-left: -20px;margin-right: -20px">item3</div>
    <div class="item float-left border-red">item4</div>
</div>
</body>
</html>